From: Florian Müllner Date: Thu, 2 Aug 2018 21:54:08 +0000 (+0200) Subject: networkAgent: Fix another ByteArray => Uint8Array instance X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~929^2~3^2~21 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=afe57037103451929decaeacdd32f1c3cf9087f1;p=gnome-shell.git networkAgent: Fix another ByteArray => Uint8Array instance This was missed in commit 7ca418a79a. As we are dealing with non-\0-terminated data here, go through GBytes this time. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/189 --- diff --git a/js/ui/components/networkAgent.js b/js/ui/components/networkAgent.js index 5bd648a73..998fcb792 100644 --- a/js/ui/components/networkAgent.js +++ b/js/ui/components/networkAgent.js @@ -506,8 +506,12 @@ var VPNRequestHandler = new Lang.Class({ try { data = this._dataStdout.peek_buffer(); - keyfile.load_from_data(data.toString(), data.length, - GLib.KeyFileFlags.NONE); + if (data instanceof Uint8Array) + data = imports.byteArray.toGBytes(data); + else + data = data.toGBytes(); + + keyfile.load_from_bytes(data, GLib.KeyFileFlags.NONE); if (keyfile.get_integer(VPN_UI_GROUP, 'Version') != 2) throw new Error('Invalid plugin keyfile version, is %d');